home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  3.8 KB  |  117 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CommResources.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CommResources;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __COMMRESOURCES__}
  27. {$SETC __COMMRESOURCES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CommResourcesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __OSUTILS__}
  35. {$I OSUtils.p}
  36. {$ENDC}
  37. {    Types.p                                                        }
  38. {        ConditionalMacros.p                                        }
  39. {    MixedMode.p                                                    }
  40. {    Memory.p                                                    }
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. CONST
  47. {    tool classes (also the tool file types)    }
  48.     classCM                        = 'cbnd';
  49.     classFT                        = 'fbnd';
  50.     classTM                        = 'tbnd';
  51.  
  52. {    version of the Comm Resource Manager    }
  53.     curCRMVersion                = 2;
  54. { constants general to the use of the Communications Resource Manager }
  55.     crmType                        = 9;                            { queue type    }
  56.     crmRecVersion                = 1;                            { version of queue structure }
  57. {    error codes }
  58.     crmGenericError                = -1;
  59.     crmNoErr                    = 0;
  60.  
  61. { data structures general to the use of the Communications Resource Manager }
  62.     
  63. TYPE
  64.     CRMErr = OSErr;
  65.  
  66.     CRMRec = RECORD
  67.         qLink:                    QElemPtr;                                {reserved}
  68.         qType:                    INTEGER;                                {queue type -- ORD(crmType) = 9}
  69.         crmVersion:                INTEGER;                                {version of queue element data structure}
  70.         crmPrivate:                LONGINT;                                {reserved}
  71.         crmReserved:            INTEGER;                                {reserved}
  72.         crmDeviceType:            LONGINT;                                {type of device, assigned by DTS}
  73.         crmDeviceID:            LONGINT;                                {device ID; assigned when CRMInstall is called}
  74.         crmAttributes:            LONGINT;                                {pointer to attribute block}
  75.         crmStatus:                LONGINT;                                {status variable - device specific}
  76.         crmRefCon:                LONGINT;                                {for device private use}
  77.     END;
  78.     CRMRecPtr = ^CRMRec;
  79.  
  80.  
  81. FUNCTION InitCRM: CRMErr;
  82. FUNCTION CRMGetHeader: QHdrPtr;
  83. PROCEDURE CRMInstall(crmReqPtr: CRMRecPtr);
  84. FUNCTION CRMRemove(crmReqPtr: CRMRecPtr): OSErr;
  85. FUNCTION CRMSearch(crmReqPtr: CRMRecPtr): CRMRecPtr;
  86. FUNCTION CRMGetCRMVersion: INTEGER;
  87. FUNCTION CRMGetResource(theType: ResType; theID: INTEGER): Handle;
  88. FUNCTION CRMGet1Resource(theType: ResType; theID: INTEGER): Handle;
  89. FUNCTION CRMGetIndResource(theType: ResType; index: INTEGER): Handle;
  90. FUNCTION CRMGet1IndResource(theType: ResType; index: INTEGER): Handle;
  91. FUNCTION CRMGetNamedResource(theType: ResType; name: ConstStr255Param): Handle;
  92. FUNCTION CRMGet1NamedResource(theType: ResType; name: ConstStr255Param): Handle;
  93. PROCEDURE CRMReleaseResource(theHandle: Handle);
  94. FUNCTION CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  95. FUNCTION CRMGetToolNamedResource(procID: INTEGER; theType: ResType; name: ConstStr255Param): Handle;
  96. PROCEDURE CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  97. FUNCTION CRMGetIndex(theHandle: Handle): LONGINT;
  98. FUNCTION CRMLocalToRealID(bundleType: ResType; toolID: INTEGER; theType: ResType; localID: INTEGER): INTEGER;
  99. FUNCTION CRMRealToLocalID(bundleType: ResType; toolID: INTEGER; theType: ResType; realID: INTEGER): INTEGER;
  100. FUNCTION CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  101. FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  102. FUNCTION CRMIsDriverOpen(driverName: ConstStr255Param): BOOLEAN;
  103. FUNCTION CRMParseCAPSResource(theHandle: Handle; selector: ResType; VAR value: LONGINT): CRMErr;
  104. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  105. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  106.  
  107. {$ALIGN RESET}
  108. {$POP}
  109.  
  110. {$SETC UsingIncludes := CommResourcesIncludes}
  111.  
  112. {$ENDC} {__COMMRESOURCES__}
  113.  
  114. {$IFC NOT UsingIncludes}
  115.  END.
  116. {$ENDC}
  117.